<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <cpn>
            <button>这是插槽中的东西---按钮</button>
        </cpn>

        <cpn>
            <h2>这是插槽</h2>
        </cpn>

        <cpn></cpn>
    </div>



    <template id="CPN">
        <div>
            <p>我是p1</p>
            <!-- slog插槽，使组件具有拓展性 -->
            <slot><button>如果没有传，这是显示的默认插槽</button></slot>
        </div>
    </template>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                message: '我是你爹!'
            },
            methods: {},
            components: {
                cpn: {
                    template: '#CPN',
                }
            }
        });
    </script>
</body>

</html>